package com.example.demo02datajdbc.dao.impl;

import com.example.demo02datajdbc.dao.UserDao;
import com.example.demo02datajdbc.model.User;
import jakarta.annotation.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.security.spec.NamedParameterSpec;

@Repository
public class UserDaoImpl implements UserDao {
    @Resource
    private JdbcTemplate jdbcTemplate;
    @Override
    public int addUser(User user) {
        String sql = "insert into `user` (`user`.user_name,`user`.status) values(?,?);";
        return jdbcTemplate.update(sql,user.getUserName(),user.getStatus());
    }
}
